#pragma once
#include "GameComponent.h"
#include "rendering/Material.h"
#include "event/Event_GameObject_Moved.h"
#include "Messenger.h"



namespace Boon
{

class BOON_API Renderer : public GameComponent
{
public:
	
	Rendering::Material&			GetMaterial() { return m_Material; }
	void							SetMaterial( const Rendering::Material& m ) { m_Material = m; }
	RenderPass						GetRenderPass() const { return m_RenderPass; }
	void							SetRenderPass( RenderPass rp ) { m_RenderPass = rp; }

protected:
	Renderer( const char* compName, Boon::GameObject* g );

	virtual IMessengerEventStrong		GetEventCreateSceneNode() = 0;

	virtual void					Update();
	virtual void					LateUpdate();
	virtual void					OnCreate();
	virtual void					OnStart();
	virtual void					OnEnable();
	virtual void					OnDisable();
	virtual void					OnDestroy();



	Rendering::Material							m_Material;
	RenderPass									m_RenderPass;
	Messenger&									m_Messenger;

private:

	Weak_ptr<Event_GameObject_Moved>		m_EventUpdateNode;			/*!< Storing weak reference to determine if bang or update (unprocessed) event */
};


}
